{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-page">
	<h3 class="pb-3">佣金</h3>
	<table class="layui-table layui-table-form">
		<tr>
			<td class="layui-td-gray">名称<font>*</font></td>
			<td><input type="text" name="title" lay-verify="required" placeholder="请输入名称" lay-reqText="请输入名称" class="layui-input" value="{$nav.title|default=''}"></td>
		</tr>
		<tr>
			<td class="layui-td-gray">平台佣金（%）<font>*</font></td>
			<td><input type="text" name="desc[]" lay-verify="required" placeholder="请输入平台佣金" lay-reqText="请输入平台佣金" class="layui-input" value="{$nav.desc.0|default=''}"></td>
			<td class="layui-td-gray">广告费用（%）<font>*</font></td>
			<td><input type="text" name="desc[]" lay-verify="required" placeholder="请输入广告费用" lay-reqText="请输入广告费用" class="layui-input" value="{$nav.desc.1|default=''}"></td>
			<td class="layui-td-gray">店主抽佣（%）<font>*</font></td>
			<td><input type="text" name="desc[]" lay-verify="required" placeholder="请输入店主抽佣" lay-reqText="请输入店主抽佣" class="layui-input" value="{$nav.desc.2|default=''}"></td>
		</tr>


	</table>
	<div class="py-3">
		<input type="hidden" name="id" value="{$id}" />
		<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
		<button type="reset" class="layui-btn layui-btn-primary">重置</button>
	</div>
</form>
{/block}
<!-- /主体 -->

<!-- 脚本 -->
{block name="script"}
<script>
	const moduleInit = ['tool'];
	function gouguInit() {
		var form = layui.form,tool=layui.tool;
		//监听提交
		form.on('submit(webform)', function (data) {
			let callback = function (e) {
				layer.msg(e.msg);
				if (e.code == 0) {
					tool.sideClose(1000);
				}
			}
			tool.post("/admin/nav/add", data.field, callback);
			return false;
		});
	}
</script>
{/block}
<!-- /脚本 -->